#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Wjy


class Response(object):

    def __init__(self):
        self.err = "The service is abnormal, please try again later"
        self.code = 1
        self.head = dict()
        self.biz = dict()

    def set_head(self):
        self.head.update({"err": self.err, "code": self.code})

    @staticmethod
    def keys():
        return ["head", "biz"]

    def __getitem__(self, item):
        return getattr(self, item)
